class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

b = A("b")
h = B("h")
a = C("a")
d = D("d")
j = E("j")
l = F("l")
m = G("m")
n = F("n")
e = D("e")

b.u = h
h.x = m
h.y = m
h.o = d
h.r = a
a.y = j
a.o = b
a.z = n
d.p = n
d.q = l
j.x = b
j.v = l
j.u = a
j.q = d
l.s = n
l.y = n
l.o = j
l.q = m
l.t = m
l.p = b
l.u = b
m.u = e
m.x = j
m.q = j
m.p = h
n.s = l
n.y = l
n.o = j
n.q = m
n.t = m
n.p = b
n.u = b
e.p = n
e.q = n
assert m.u.q.o.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

b = A("b")
h = B("h")
a = C("a")
d = D("d")
j = E("j")
l = F("l")
m = G("m")
n = F("n")
e = D("e")

b.u = h
h.x = m
h.y = m
h.o = d
h.r = a
a.y = j
a.o = b
a.z = n
d.p = n
d.q = l
j.x = b
j.v = l
j.u = a
j.q = d
l.s = n
l.y = n
l.o = j
l.q = m
l.t = m
l.p = b
l.u = b
m.u = e
m.x = j
m.q = j
m.p = h
n.s = l
n.y = l
n.o = j
n.q = m
n.t = m
n.p = b
n.u = b
e.p = n
e.q = n
assert m.u.q.o.q.p.txt == "n"