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

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

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

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

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

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

b = A("b")
i = B("i")
g = C("g")
c = D("c")
e = E("e")
n = F("n")

b.w = i
b.z = i
b.x = n
b.u = e
b.o = e
b.p = g
i.u = c
i.p = e
g.t = i
g.p = i
g.r = e
c.q = n
c.s = n
c.o = i
e.o = g
e.x = n
n.z = e
n.r = b
n.u = g
assert e.o.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: F = None
        self.u: E = None
        self.o: E = None
        self.z: B = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

b = A("b")
i = B("i")
g = C("g")
c = D("c")
e = E("e")
n = F("n")

b.w = i
b.z = i
b.x = n
b.u = e
b.o = e
b.p = g
i.u = c
i.p = e
g.t = i
g.p = i
g.r = e
c.q = n
c.s = n
c.o = i
e.o = g
e.x = n
n.z = e
n.r = b
n.u = g
assert e.o.p.u.txt == "c"