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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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