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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

c = A("c")
g = B("g")
n = C("n")
b = D("b")
e = E("e")
k = F("k")
m = E("m")
d = D("d")
f = A("f")
h = B("h")

c.y = m
c.t = n
c.o = n
c.z = f
g.z = c
g.v = n
g.u = h
g.r = m
n.q = k
n.s = k
b.u = h
b.t = k
b.x = n
e.u = n
e.w = n
e.y = g
k.q = f
k.t = d
k.r = n
m.u = n
m.w = n
m.y = g
d.u = g
d.t = k
d.x = n
f.y = e
f.t = n
f.o = n
f.z = c
h.z = c
h.v = n
h.u = g
h.r = m
assert d.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.o: C = None
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

c = A("c")
g = B("g")
n = C("n")
b = D("b")
e = E("e")
k = F("k")
m = E("m")
d = D("d")
f = A("f")
h = B("h")

c.y = m
c.t = n
c.o = n
c.z = f
g.z = c
g.v = n
g.u = h
g.r = m
n.q = k
n.s = k
b.u = h
b.t = k
b.x = n
e.u = n
e.w = n
e.y = g
k.q = f
k.t = d
k.r = n
m.u = n
m.w = n
m.y = g
d.u = g
d.t = k
d.x = n
f.y = e
f.t = n
f.o = n
f.z = c
h.z = c
h.v = n
h.u = g
h.r = m
assert d.t.t.t.txt == "k"