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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: B = None
        self.w: A = None
        self.u: E = None
        self.o: E = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: E = None
        self.u: B = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: D = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: B = None
        self.w: A = None
        self.u: E = None
        self.o: E = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: E = None
        self.u: B = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: D = None
        self.q: B = None
        self.txt = txt

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

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