class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: B = None
        self.q: E = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: H = None
        self.v: H = None
        self.x: E = None
        self.t: F = None
        self.y: G = None
        self.o: H = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: B = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.w: G = None
        self.s: F = None
        self.r: D = None
        self.t: F = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: H = None
        self.v: H = None
        self.x: E = None
        self.t: F = None
        self.y: G = None
        self.o: H = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: B = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.w: G = None
        self.s: F = None
        self.r: D = None
        self.t: F = None
        self.x: D = None
        self.txt = txt

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

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