class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.u: H = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: E = None
        self.u: C = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: E = None
        self.u: C = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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