class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: E = None
        self.x: D = None
        self.v: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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