class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: E = None
        self.s: D = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: C = None
        self.v: D = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: G = None
        self.s: B = None
        self.w: A = None
        self.x: H = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: E = None
        self.s: D = None
        self.u: C = None
        self.v: H = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.q: E = None
        self.txt = txt

f = A("f")
i = B("i")
a = C("a")
l = D("l")
e = E("e")
h = F("h")
m = G("m")
c = H("c")

f.p = i
f.t = e
f.s = l
f.v = a
i.t = f
i.y = a
i.v = l
i.r = c
a.t = e
a.q = m
a.s = i
a.w = f
a.x = c
a.z = l
l.z = f
e.t = l
e.u = i
e.x = i
h.o = i
h.s = c
m.t = a
m.u = a
m.x = a
m.p = e
m.s = l
m.v = c
m.w = f
c.v = l
c.r = i
c.q = e
assert l.z.t.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: E = None
        self.s: D = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: C = None
        self.v: D = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: G = None
        self.s: B = None
        self.w: A = None
        self.x: H = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: E = None
        self.s: D = None
        self.u: C = None
        self.v: H = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.q: E = None
        self.txt = txt

f = A("f")
i = B("i")
a = C("a")
l = D("l")
e = E("e")
h = F("h")
m = G("m")
c = H("c")

f.p = i
f.t = e
f.s = l
f.v = a
i.t = f
i.y = a
i.v = l
i.r = c
a.t = e
a.q = m
a.s = i
a.w = f
a.x = c
a.z = l
l.z = f
e.t = l
e.u = i
e.x = i
h.o = i
h.s = c
m.t = a
m.u = a
m.x = a
m.p = e
m.s = l
m.v = c
m.w = f
c.v = l
c.r = i
c.q = e
assert l.z.t.x.t.txt == "f"