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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: G = None
        self.t: G = None
        self.x: C = None
        self.p: H = None
        self.s: G = None
        self.w: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: A = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: G = None
        self.t: G = None
        self.x: C = None
        self.p: H = None
        self.s: G = None
        self.w: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: A = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

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

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