class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: D = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.s: G = None
        self.o: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: H = None
        self.y: G = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.u: A = None
        self.z: A = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: D = None
        self.q: C = None
        self.w: B = None
        self.txt = txt

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

c.x = i
c.p = h
c.u = f
c.z = f
a.y = b
j.w = c
j.v = i
j.s = k
j.o = k
h.t = j
i.w = k
l.o = f
l.x = f
l.y = k
l.v = h
k.t = i
k.w = c
k.u = c
k.z = c
k.y = c
f.x = b
f.w = b
f.r = n
f.q = j
b.y = a
n.t = j
assert f.r.t.w.z.r.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: D = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.s: G = None
        self.o: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: H = None
        self.y: G = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.u: A = None
        self.z: A = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: D = None
        self.q: C = None
        self.w: B = None
        self.txt = txt

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

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