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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.w: D = None
        self.t: C = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.w: D = None
        self.t: C = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

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

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