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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.s: E = None
        self.o: F = None
        self.txt = txt

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

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

b = A("b")
c = B("c")
j = C("j")
d = D("d")
f = E("f")
a = F("a")
e = C("e")
g = F("g")

b.u = a
b.r = j
b.p = f
c.o = b
j.u = e
j.o = d
d.w = j
d.y = f
d.s = f
d.o = a
f.t = c
f.w = b
a.v = b
a.x = g
a.t = e
a.o = c
a.w = j
a.s = d
e.u = j
e.o = d
g.v = b
g.x = a
g.t = e
g.o = c
g.w = j
g.s = d
assert c.o.u.s.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: C = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.s: E = None
        self.o: F = None
        self.txt = txt

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

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

b = A("b")
c = B("c")
j = C("j")
d = D("d")
f = E("f")
a = F("a")
e = C("e")
g = F("g")

b.u = a
b.r = j
b.p = f
c.o = b
j.u = e
j.o = d
d.w = j
d.y = f
d.s = f
d.o = a
f.t = c
f.w = b
a.v = b
a.x = g
a.t = e
a.o = c
a.w = j
a.s = d
e.u = j
e.o = d
g.v = b
g.x = a
g.t = e
g.o = c
g.w = j
g.s = d
assert c.o.u.s.w.u.txt == "e"