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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: E = None
        self.s: A = None
        self.t: D = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: E = None
        self.s: A = None
        self.t: D = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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