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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.t: C = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.x: A = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

h = A("h")
m = B("m")
j = C("j")
n = D("n")
c = E("c")
i = F("i")
f = B("f")
b = E("b")

h.t = j
h.y = m
m.z = j
m.x = j
m.t = j
m.w = i
j.t = h
j.p = c
j.v = i
n.u = j
n.v = j
n.z = i
c.v = m
c.x = h
c.t = j
c.s = j
c.u = b
c.o = n
i.z = j
i.q = b
i.x = h
i.w = h
i.t = h
f.z = j
f.x = j
f.t = j
f.w = i
b.v = f
b.x = h
b.t = j
b.s = j
b.u = c
b.o = n
assert j.t.t.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.t: C = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.x: A = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

h = A("h")
m = B("m")
j = C("j")
n = D("n")
c = E("c")
i = F("i")
f = B("f")
b = E("b")

h.t = j
h.y = m
m.z = j
m.x = j
m.t = j
m.w = i
j.t = h
j.p = c
j.v = i
n.u = j
n.v = j
n.z = i
c.v = m
c.x = h
c.t = j
c.s = j
c.u = b
c.o = n
i.z = j
i.q = b
i.x = h
i.w = h
i.t = h
f.z = j
f.x = j
f.t = j
f.w = i
b.v = f
b.x = h
b.t = j
b.s = j
b.u = c
b.o = n
assert j.t.t.t.y.txt == "m"