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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.r: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.r: C = None
        self.txt = txt

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

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