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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: D = None
        self.o: D = None
        self.y: H = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: D = None
        self.r: G = None
        self.t: G = None
        self.q: B = None
        self.x: C = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: C = None
        self.q: B = None
        self.x: H = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: E = None
        self.r: C = None
        self.u: A = None
        self.txt = txt

j = A("j")
e = B("e")
n = C("n")
d = D("d")
g = E("g")
h = F("h")
b = G("b")
f = H("f")
c = D("c")

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: D = None
        self.o: D = None
        self.y: H = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: D = None
        self.r: G = None
        self.t: G = None
        self.q: B = None
        self.x: C = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: C = None
        self.q: B = None
        self.x: H = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: E = None
        self.r: C = None
        self.u: A = None
        self.txt = txt

j = A("j")
e = B("e")
n = C("n")
d = D("d")
g = E("g")
h = F("h")
b = G("b")
f = H("f")
c = D("c")

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