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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: D = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.u: A = None
        self.o: A = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: D = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.u: A = None
        self.o: A = None
        self.q: G = None
        self.txt = txt

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

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

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

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