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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: G = None
        self.w: F = None
        self.z: F = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: A = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: G = None
        self.w: F = None
        self.z: F = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: A = None
        self.o: B = None
        self.txt = txt

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

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