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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: B = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

c = A("c")
k = B("k")
h = C("h")
j = D("j")
g = E("g")
a = F("a")
l = G("l")

c.t = k
k.y = a
k.u = j
k.x = j
h.q = j
h.s = j
h.u = j
j.z = l
j.u = k
j.p = h
j.t = h
j.s = h
j.r = g
g.q = h
g.v = c
a.r = j
a.v = c
a.p = g
l.s = k
l.t = k
l.v = j
l.r = c
assert j.z.s.x.p.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: B = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

c = A("c")
k = B("k")
h = C("h")
j = D("j")
g = E("g")
a = F("a")
l = G("l")

c.t = k
k.y = a
k.u = j
k.x = j
h.q = j
h.s = j
h.u = j
j.z = l
j.u = k
j.p = h
j.t = h
j.s = h
j.r = g
g.q = h
g.v = c
a.r = j
a.v = c
a.p = g
l.s = k
l.t = k
l.v = j
l.r = c
assert j.z.s.x.p.q.u.txt == "k"