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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: F = None
        self.x: F = None
        self.u: A = None
        self.p: F = None
        self.y: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: F = None
        self.x: F = None
        self.u: A = None
        self.p: F = None
        self.y: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: A = None
        self.txt = txt

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

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