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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.p: F = None
        self.q: E = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: A = None
        self.v: A = None
        self.z: G = None
        self.o: B = None
        self.y: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.p: F = None
        self.q: E = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: A = None
        self.v: A = None
        self.z: G = None
        self.o: B = None
        self.y: D = None
        self.txt = txt

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

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

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

k.x = j
l.y = b
l.s = b
l.p = g
l.q = f
l.t = c
c.q = j
b.w = l
b.q = c
f.r = e
f.y = e
f.u = k
f.v = k
f.z = h
f.o = l
g.t = j
h.s = g
h.u = g
h.t = g
h.z = c
h.p = b
j.r = e
j.y = e
j.u = k
j.v = k
j.z = h
j.o = l
e.w = l
e.q = c
assert g.t.r.w.q.o.txt == "l"