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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: C = None
        self.y: A = None
        self.txt = txt

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

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

g.s = k
c.p = i
a.v = k
a.y = j
a.u = b
a.x = b
a.t = b
a.r = n
j.u = i
j.y = g
i.s = n
i.r = j
i.z = c
k.z = b
n.u = b
n.p = a
n.y = g
b.v = i
b.z = i
b.p = g
assert b.v.s.u.p.s.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: C = None
        self.y: A = None
        self.txt = txt

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

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

g.s = k
c.p = i
a.v = k
a.y = j
a.u = b
a.x = b
a.t = b
a.r = n
j.u = i
j.y = g
i.s = n
i.r = j
i.z = c
k.z = b
n.u = b
n.p = a
n.y = g
b.v = i
b.z = i
b.p = g
assert b.v.s.u.p.s.z.z.txt == "i"