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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: H = None
        self.u: E = None
        self.t: G = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: H = None
        self.y: C = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.z: B = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: H = None
        self.u: E = None
        self.t: G = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: H = None
        self.y: C = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.z: B = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

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