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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: C = None
        self.t: A = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: A = None
        self.z: G = None
        self.r: D = None
        self.o: H = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: C = None
        self.t: A = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: A = None
        self.z: G = None
        self.r: D = None
        self.o: H = None
        self.x: D = None
        self.txt = txt

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

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