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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: G = None
        self.z: E = None
        self.s: I = None
        self.x: I = None
        self.t: E = None
        self.q: A = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: I = None
        self.x: A = None
        self.u: E = None
        self.t: I = None
        self.q: B = None
        self.p: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: H = None
        self.u: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: A = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: C = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: F = None
        self.v: E = None
        self.t: B = None
        self.r: B = None
        self.u: I = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: G = None
        self.z: E = None
        self.s: I = None
        self.x: I = None
        self.t: E = None
        self.q: A = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: I = None
        self.x: A = None
        self.u: E = None
        self.t: I = None
        self.q: B = None
        self.p: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: H = None
        self.u: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: A = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: C = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: F = None
        self.v: E = None
        self.t: B = None
        self.r: B = None
        self.u: I = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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