class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.p: G = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.p: G = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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