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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: G = None
        self.p: C = None
        self.o: C = None
        self.u: B = None
        self.v: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: C = None
        self.t: A = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

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

g.t = e
k.y = i
e.s = g
d.q = a
n.u = d
n.p = d
n.o = i
i.s = c
i.x = c
i.v = c
i.p = e
i.o = e
i.u = k
c.v = a
c.x = n
a.u = i
a.p = i
a.v = i
a.z = e
a.t = g
assert c.x.o.x.x.o.u.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: G = None
        self.p: C = None
        self.o: C = None
        self.u: B = None
        self.v: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: C = None
        self.t: A = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

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

g.t = e
k.y = i
e.s = g
d.q = a
n.u = d
n.p = d
n.o = i
i.s = c
i.x = c
i.v = c
i.p = e
i.o = e
i.u = k
c.v = a
c.x = n
a.u = i
a.p = i
a.v = i
a.z = e
a.t = g
assert c.x.o.x.x.o.u.y.u.txt == "k"