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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.x: F = None
        self.v: D = None
        self.p: C = None
        self.txt = txt

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

a = A("a")
e = B("e")
f = C("f")
i = D("i")
j = E("j")
m = F("m")
g = A("g")
k = B("k")

a.t = k
a.u = g
a.s = j
a.w = m
e.u = m
e.p = i
e.r = j
f.r = m
i.q = j
j.q = f
j.p = f
j.t = g
j.x = m
j.v = i
m.z = j
m.r = j
m.x = g
m.o = e
g.t = k
g.u = a
g.s = j
g.w = m
k.u = m
k.p = i
k.r = j
assert g.w.x.u.t.u.x.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: A = None
        self.s: E = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.x: F = None
        self.v: D = None
        self.p: C = None
        self.txt = txt

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

a = A("a")
e = B("e")
f = C("f")
i = D("i")
j = E("j")
m = F("m")
g = A("g")
k = B("k")

a.t = k
a.u = g
a.s = j
a.w = m
e.u = m
e.p = i
e.r = j
f.r = m
i.q = j
j.q = f
j.p = f
j.t = g
j.x = m
j.v = i
m.z = j
m.r = j
m.x = g
m.o = e
g.t = k
g.u = a
g.s = j
g.w = m
k.u = m
k.p = i
k.r = j
assert g.w.x.u.t.u.x.u.t.txt == "k"