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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: E = None
        self.q: C = None
        self.t: F = None
        self.u: E = None
        self.z: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.y: D = None
        self.x: C = None
        self.txt = txt

l = A("l")
a = B("a")
d = C("d")
b = D("b")
h = E("h")
f = F("f")
g = A("g")
m = C("m")
c = F("c")

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: E = None
        self.q: C = None
        self.t: F = None
        self.u: E = None
        self.z: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.y: D = None
        self.x: C = None
        self.txt = txt

l = A("l")
a = B("a")
d = C("d")
b = D("b")
h = E("h")
f = F("f")
g = A("g")
m = C("m")
c = F("c")

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