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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

a = A("a")
j = B("j")
k = C("k")
m = D("m")
c = E("c")
e = F("e")
d = F("d")

a.r = c
a.u = c
j.o = k
j.y = k
k.x = j
k.y = j
k.r = d
k.w = m
k.o = e
m.v = j
c.q = j
c.x = a
e.x = c
e.r = c
e.u = k
e.w = a
e.p = a
e.s = j
d.x = c
d.r = c
d.u = k
d.w = a
d.p = a
d.s = j
assert e.w.u.x.u.x.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

a = A("a")
j = B("j")
k = C("k")
m = D("m")
c = E("c")
e = F("e")
d = F("d")

a.r = c
a.u = c
j.o = k
j.y = k
k.x = j
k.y = j
k.r = d
k.w = m
k.o = e
m.v = j
c.q = j
c.x = a
e.x = c
e.r = c
e.u = k
e.w = a
e.p = a
e.s = j
d.x = c
d.r = c
d.u = k
d.w = a
d.p = a
d.s = j
assert e.w.u.x.u.x.u.q.txt == "j"