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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: A = None
        self.u: A = None
        self.w: A = None
        self.x: C = None
        self.z: D = None
        self.txt = txt

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

i.u = f
i.q = d
d.o = i
d.v = i
d.x = i
d.s = e
d.p = e
d.w = f
f.z = l
e.r = d
j.v = e
j.w = e
j.q = a
a.v = l
a.q = i
a.u = i
a.w = i
a.x = f
a.z = e
h.v = e
h.w = e
h.q = a
l.v = a
l.q = i
l.u = i
l.w = i
l.x = f
l.z = e
assert j.v.r.p.r.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: A = None
        self.u: A = None
        self.w: A = None
        self.x: C = None
        self.z: D = None
        self.txt = txt

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

i.u = f
i.q = d
d.o = i
d.v = i
d.x = i
d.s = e
d.p = e
d.w = f
f.z = l
e.r = d
j.v = e
j.w = e
j.q = a
a.v = l
a.q = i
a.u = i
a.w = i
a.x = f
a.z = e
h.v = e
h.w = e
h.q = a
l.v = a
l.q = i
l.u = i
l.w = i
l.x = f
l.z = e
assert j.v.r.p.r.w.z.txt == "l"