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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.p: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

a.t = m
a.x = m
a.v = h
a.q = i
f.y = l
f.z = l
f.x = i
f.p = a
l.o = m
j.x = l
m.x = i
e.p = h
e.u = j
d.x = l
h.p = e
h.u = d
g.y = l
g.z = l
g.x = i
g.p = a
i.t = m
i.x = m
i.v = h
i.q = a
assert m.x.x.x.v.u.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: F = None
        self.x: E = None
        self.q: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.p: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

a.t = m
a.x = m
a.v = h
a.q = i
f.y = l
f.z = l
f.x = i
f.p = a
l.o = m
j.x = l
m.x = i
e.p = h
e.u = j
d.x = l
h.p = e
h.u = d
g.y = l
g.z = l
g.x = i
g.p = a
i.t = m
i.x = m
i.v = h
i.q = a
assert m.x.x.x.v.u.x.o.txt == "m"