class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: H = None
        self.u: B = None
        self.t: C = None
        self.o: E = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.r: F = None
        self.y: E = None
        self.z: B = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.z: B = None
        self.q: G = None
        self.p: G = None
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: F = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

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

j = A("j")
f = B("f")
k = C("k")
e = D("e")
l = E("l")
m = F("m")
a = G("a")
d = H("d")
c = C("c")

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: H = None
        self.u: B = None
        self.t: C = None
        self.o: E = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.r: F = None
        self.y: E = None
        self.z: B = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.z: B = None
        self.q: G = None
        self.p: G = None
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: F = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

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

j = A("j")
f = B("f")
k = C("k")
e = D("e")
l = E("l")
m = F("m")
a = G("a")
d = H("d")
c = C("c")

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