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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: G = None
        self.s: A = None
        self.y: A = None
        self.u: G = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: A = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.x: C = None
        self.v: B = None
        self.s: F = None
        self.txt = txt

l = A("l")
d = B("d")
m = C("m")
g = D("g")
j = E("j")
f = F("f")
n = G("n")
k = D("k")

l.p = g
d.w = f
d.z = l
m.y = l
m.x = l
m.p = f
m.z = f
m.s = n
m.t = g
m.q = g
g.x = j
g.z = n
g.o = n
g.p = f
g.u = l
g.r = d
j.v = n
j.r = n
j.u = n
j.s = l
j.y = l
j.x = m
f.o = k
f.r = l
f.z = j
f.q = n
n.z = f
n.s = f
n.t = m
n.x = m
n.v = d
k.x = j
k.z = n
k.o = n
k.p = f
k.u = l
k.r = d
assert l.p.u.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: G = None
        self.s: A = None
        self.y: A = None
        self.u: G = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: A = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.x: C = None
        self.v: B = None
        self.s: F = None
        self.txt = txt

l = A("l")
d = B("d")
m = C("m")
g = D("g")
j = E("j")
f = F("f")
n = G("n")
k = D("k")

l.p = g
d.w = f
d.z = l
m.y = l
m.x = l
m.p = f
m.z = f
m.s = n
m.t = g
m.q = g
g.x = j
g.z = n
g.o = n
g.p = f
g.u = l
g.r = d
j.v = n
j.r = n
j.u = n
j.s = l
j.y = l
j.x = m
f.o = k
f.r = l
f.z = j
f.q = n
n.z = f
n.s = f
n.t = m
n.x = m
n.v = d
k.x = j
k.z = n
k.o = n
k.p = f
k.u = l
k.r = d
assert l.p.u.p.u.p.txt == "g"