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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

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

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

d.r = b
d.y = j
i.t = b
b.o = l
a.u = l
m.t = i
m.z = i
m.x = h
h.z = d
h.v = i
g.z = h
g.o = h
g.r = a
g.u = a
l.u = h
l.t = h
l.q = m
l.r = m
l.o = n
l.p = d
l.z = j
n.u = h
n.t = h
n.q = m
n.r = m
n.o = l
n.p = d
n.z = g
j.z = h
j.o = h
j.r = a
j.u = a
assert g.u.u.p.y.z.z.txt == "d"