class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: A = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: G = None
        self.y: B = None
        self.v: H = None
        self.r: G = None
        self.w: G = None
        self.s: H = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: F = None
        self.q: B = None
        self.t: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: C = None
        self.y: A = None
        self.z: G = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: F = None
        self.q: C = None
        self.u: C = None
        self.y: I = None
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.y: F = None
        self.t: F = None
        self.txt = txt

l = A("l")
g = B("g")
e = C("e")
a = D("a")
i = E("i")
b = F("b")
d = G("d")
k = H("k")
c = I("c")
j = A("j")

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: G = None
        self.y: B = None
        self.v: H = None
        self.r: G = None
        self.w: G = None
        self.s: H = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: F = None
        self.q: B = None
        self.t: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: C = None
        self.y: A = None
        self.z: G = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: F = None
        self.q: C = None
        self.u: C = None
        self.y: I = None
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.y: F = None
        self.t: F = None
        self.txt = txt

l = A("l")
g = B("g")
e = C("e")
a = D("a")
i = E("i")
b = F("b")
d = G("d")
k = H("k")
c = I("c")
j = A("j")

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