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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: F = None
        self.p: B = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: B = None
        self.u: A = None
        self.z: B = None
        self.txt = txt

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

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

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

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

i = A("i")
a = B("a")
m = C("m")
c = D("c")
k = E("k")
l = F("l")
b = G("b")
h = H("h")
n = G("n")

i.y = m
i.u = b
i.w = b
a.r = k
m.o = a
m.p = a
m.v = l
m.x = n
c.r = h
c.x = a
c.z = a
c.u = i
k.w = n
l.o = i
l.r = i
l.q = c
l.u = h
l.x = k
b.o = m
b.u = m
b.s = l
b.q = n
b.x = c
h.q = c
n.o = m
n.u = m
n.s = l
n.q = b
n.x = c
assert n.q.u.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: G = None
        self.w: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: F = None
        self.p: B = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: B = None
        self.u: A = None
        self.z: B = None
        self.txt = txt

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

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

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

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

i = A("i")
a = B("a")
m = C("m")
c = D("c")
k = E("k")
l = F("l")
b = G("b")
h = H("h")
n = G("n")

i.y = m
i.u = b
i.w = b
a.r = k
m.o = a
m.p = a
m.v = l
m.x = n
c.r = h
c.x = a
c.z = a
c.u = i
k.w = n
l.o = i
l.r = i
l.q = c
l.u = h
l.x = k
b.o = m
b.u = m
b.s = l
b.q = n
b.x = c
h.q = c
n.o = m
n.u = m
n.s = l
n.q = b
n.x = c
assert n.q.u.v.r.txt == "i"