class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.w: E = None
        self.v: C = None
        self.z: F = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.o: D = None
        self.p: G = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: G = None
        self.txt = txt

k = A("k")
j = B("j")
d = C("d")
f = D("f")
g = E("g")
i = F("i")
e = G("e")
c = H("c")

k.r = d
k.v = d
k.t = g
k.w = g
k.z = i
k.o = e
j.p = c
d.s = c
d.t = e
d.z = i
d.r = i
d.q = g
f.q = e
f.x = e
f.o = c
f.v = c
f.s = i
g.v = i
g.o = e
i.s = e
i.y = e
i.p = e
i.o = f
i.v = g
e.s = c
e.x = j
c.r = g
c.p = e
assert i.y.s.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.w: E = None
        self.v: C = None
        self.z: F = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.o: D = None
        self.p: G = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: G = None
        self.txt = txt

k = A("k")
j = B("j")
d = C("d")
f = D("f")
g = E("g")
i = F("i")
e = G("e")
c = H("c")

k.r = d
k.v = d
k.t = g
k.w = g
k.z = i
k.o = e
j.p = c
d.s = c
d.t = e
d.z = i
d.r = i
d.q = g
f.q = e
f.x = e
f.o = c
f.v = c
f.s = i
g.v = i
g.o = e
i.s = e
i.y = e
i.p = e
i.o = f
i.v = g
e.s = c
e.x = j
c.r = g
c.p = e
assert i.y.s.p.s.txt == "c"