class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: A = None
        self.u: A = None
        self.o: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

l.w = f
l.t = m
l.u = m
l.o = d
l.x = h
c.z = l
c.r = b
c.o = b
d.u = i
d.r = b
i.r = d
i.z = e
b.p = c
b.y = i
e.q = d
e.x = i
e.y = i
e.v = i
e.o = c
e.t = j
j.q = d
j.x = i
j.y = i
j.v = i
j.o = f
j.t = h
m.w = c
m.t = l
m.u = l
m.o = d
m.x = j
h.q = d
h.x = i
h.y = i
h.v = i
h.o = c
h.t = j
f.z = m
f.r = b
f.o = b
assert b.p.r.y.z.t.x.z.q.r.txt == "b"