class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: E = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: E = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

c = A("c")
n = B("n")
g = C("g")
h = D("h")
l = E("l")
a = F("a")
d = G("d")
k = H("k")
j = F("j")
f = F("f")

c.v = h
c.t = l
c.z = l
n.u = l
n.o = c
g.o = d
g.p = l
g.t = l
g.z = j
h.t = f
h.o = c
h.p = n
h.q = g
h.y = d
h.w = a
l.s = j
l.t = d
a.x = c
d.o = a
d.x = l
d.r = n
k.w = g
k.p = n
k.s = h
j.x = c
f.x = c
assert a.x.z.s.x.v.w.x.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: E = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: E = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

c = A("c")
n = B("n")
g = C("g")
h = D("h")
l = E("l")
a = F("a")
d = G("d")
k = H("k")
j = F("j")
f = F("f")

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