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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

b = A("b")
f = B("f")
e = C("e")
m = D("m")
i = E("i")
k = F("k")
c = A("c")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

b = A("b")
f = B("f")
e = C("e")
m = D("m")
i = E("i")
k = F("k")
c = A("c")

b.z = m
b.x = f
b.u = e
b.r = k
f.p = e
f.o = e
f.z = i
f.y = i
f.u = m
f.t = k
e.o = k
m.s = c
m.y = e
m.v = i
i.o = k
i.p = f
i.y = f
i.w = f
i.u = e
k.x = b
c.z = m
c.x = f
c.u = e
c.r = k
assert i.o.x.u.o.txt == "k"