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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: G = None
        self.p: A = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: G = None
        self.r: B = None
        self.z: H = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: H = None
        self.r: E = None
        self.v: D = None
        self.x: B = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: G = None
        self.p: A = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: G = None
        self.r: B = None
        self.z: H = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: H = None
        self.r: E = None
        self.v: D = None
        self.x: B = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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