class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: A = None
        self.p: A = None
        self.w: C = None
        self.s: H = None
        self.q: C = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: F = None
        self.w: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.w: D = None
        self.r: G = None
        self.p: E = None
        self.y: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: A = None
        self.p: A = None
        self.w: C = None
        self.s: H = None
        self.q: C = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: F = None
        self.w: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.w: D = None
        self.r: G = None
        self.p: E = None
        self.y: E = None
        self.txt = txt

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

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