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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: F = None
        self.r: B = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: A = None
        self.z: B = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

d = A("d")
k = B("k")
b = C("b")
c = D("c")
n = E("n")
h = F("h")
a = C("a")

d.t = c
k.s = d
k.y = d
b.x = n
b.s = n
b.u = h
b.r = k
c.o = b
c.t = d
c.z = k
c.w = h
c.r = a
n.p = b
n.t = a
n.z = k
h.y = a
h.q = c
h.x = n
h.s = d
h.z = d
a.x = n
a.s = n
a.u = h
a.r = k
assert k.y.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: F = None
        self.r: B = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: A = None
        self.z: B = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

d = A("d")
k = B("k")
b = C("b")
c = D("c")
n = E("n")
h = F("h")
a = C("a")

d.t = c
k.s = d
k.y = d
b.x = n
b.s = n
b.u = h
b.r = k
c.o = b
c.t = d
c.z = k
c.w = h
c.r = a
n.p = b
n.t = a
n.z = k
h.y = a
h.q = c
h.x = n
h.s = d
h.z = d
a.x = n
a.s = n
a.u = h
a.r = k
assert k.y.t.o.txt == "b"