class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.w: B = None
        self.o: D = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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