class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.q: B = None
        self.v: B = None
        self.u: B = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: G = None
        self.u: A = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: F = None
        self.u: F = None
        self.r: A = None
        self.w: B = None
        self.p: F = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: A = None
        self.v: D = None
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: G = None
        self.u: A = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: F = None
        self.u: F = None
        self.r: A = None
        self.w: B = None
        self.p: F = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: A = None
        self.v: D = None
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

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

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