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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: E = None
        self.x: A = None
        self.p: C = None
        self.txt = txt

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

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

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

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

k = A("k")
b = B("b")
e = C("e")
l = D("l")
c = E("c")
h = F("h")

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: E = None
        self.x: A = None
        self.p: C = None
        self.txt = txt

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

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

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

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

k = A("k")
b = B("b")
e = C("e")
l = D("l")
c = E("c")
h = F("h")

k.z = h
k.v = l
k.y = e
k.p = e
k.s = c
b.r = l
b.u = c
b.x = k
b.p = e
e.z = c
e.y = h
e.o = h
e.w = h
e.u = b
l.t = e
c.t = k
c.r = b
h.q = e
assert h.q.z.r.r.t.txt == "e"