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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: B = None
        self.z: C = None
        self.t: F = None
        self.txt = txt

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

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

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

g = A("g")
b = B("b")
d = C("d")
c = D("c")
h = E("h")
k = F("k")
m = G("m")
i = G("i")
j = F("j")
a = B("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: B = None
        self.z: C = None
        self.t: F = None
        self.txt = txt

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

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

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

g = A("g")
b = B("b")
d = C("d")
c = D("c")
h = E("h")
k = F("k")
m = G("m")
i = G("i")
j = F("j")
a = B("a")

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