class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: D = None
        self.u: D = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.q: E = None
        self.r: F = 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.x: A = None
        self.o: C = None
        self.txt = txt

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

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

a.x = l
a.s = c
a.u = c
a.z = m
m.y = j
i.o = f
i.q = f
i.x = m
i.r = d
c.v = m
f.x = a
f.o = j
l.w = m
l.x = m
l.v = m
l.q = f
l.t = c
d.w = m
d.x = m
d.v = m
d.q = f
d.t = c
j.o = f
j.q = f
j.x = m
j.r = l
assert f.x.z.y.q.o.q.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: D = None
        self.u: D = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.q: E = None
        self.r: F = 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.x: A = None
        self.o: C = None
        self.txt = txt

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

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

a.x = l
a.s = c
a.u = c
a.z = m
m.y = j
i.o = f
i.q = f
i.x = m
i.r = d
c.v = m
f.x = a
f.o = j
l.w = m
l.x = m
l.v = m
l.q = f
l.t = c
d.w = m
d.x = m
d.v = m
d.q = f
d.t = c
j.o = f
j.q = f
j.x = m
j.r = l
assert f.x.z.y.q.o.q.o.x.txt == "m"