class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: B = None
        self.o: D = None
        self.u: D = None
        self.r: E = None
        self.z: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: G = None
        self.o: A = None
        self.z: E = 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.x: G = None
        self.p: A = None
        self.y: D = None
        self.t: A = None
        self.u: C = None
        self.r: C = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: G = None
        self.o: A = None
        self.z: E = 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.x: G = None
        self.p: A = None
        self.y: D = None
        self.t: A = None
        self.u: C = None
        self.r: C = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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