class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: D = None
        self.p: C = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: H = None
        self.z: G = None
        self.s: A = None
        self.t: D = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: E = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: H = None
        self.z: G = None
        self.s: A = None
        self.t: D = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: E = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

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

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

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