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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: E = None
        self.z: F = None
        self.u: B = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

h = A("h")
n = B("n")
k = C("k")
j = D("j")
c = E("c")
b = F("b")
e = G("e")
a = C("a")

h.u = e
h.t = e
n.z = a
n.o = a
k.t = n
j.o = e
j.w = c
j.z = b
j.s = b
j.u = n
c.v = a
c.s = a
c.o = e
c.y = k
b.p = j
b.v = j
b.u = e
e.w = a
e.t = c
e.x = b
a.t = n
assert k.t.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: E = None
        self.z: F = None
        self.u: B = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

h = A("h")
n = B("n")
k = C("k")
j = D("j")
c = E("c")
b = F("b")
e = G("e")
a = C("a")

h.u = e
h.t = e
n.z = a
n.o = a
k.t = n
j.o = e
j.w = c
j.z = b
j.s = b
j.u = n
c.v = a
c.s = a
c.o = e
c.y = k
b.p = j
b.v = j
b.u = e
e.w = a
e.t = c
e.x = b
a.t = n
assert k.t.z.t.txt == "n"