class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.r: F = None
        self.w: G = None
        self.q: D = None
        self.s: E = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.q: G = None
        self.x: C = None
        self.r: A = None
        self.z: A = None
        self.y: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.x: C = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.q: G = None
        self.x: C = None
        self.r: A = None
        self.z: A = None
        self.y: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.x: C = None
        self.o: A = None
        self.txt = txt

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

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