class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: F = None
        self.r: C = None
        self.txt = txt

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

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