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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: H = None
        self.p: F = None
        self.x: E = None
        self.s: B = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: H = None
        self.y: A = None
        self.u: C = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.u: B = None
        self.v: D = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: H = None
        self.p: F = None
        self.x: E = None
        self.s: B = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: H = None
        self.y: A = None
        self.u: C = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.u: B = None
        self.v: D = None
        self.z: G = None
        self.txt = txt

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

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

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

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