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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: D = None
        self.s: D = None
        self.o: B = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: H = None
        self.txt = txt

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

b = A("b")
n = B("n")
c = C("c")
m = D("m")
l = E("l")
a = F("a")
j = G("j")
d = H("d")

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: D = None
        self.s: D = None
        self.o: B = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: H = None
        self.txt = txt

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

b = A("b")
n = B("n")
c = C("c")
m = D("m")
l = E("l")
a = F("a")
j = G("j")
d = H("d")

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