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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: F = None
        self.p: B = None
        self.s: G = None
        self.o: G = None
        self.y: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: F = None
        self.p: B = None
        self.s: G = None
        self.o: G = None
        self.y: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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