class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: F = None
        self.x: B = None
        self.v: F = None
        self.o: B = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: B = None
        self.o: D = None
        self.q: B = None
        self.t: H = None
        self.txt = txt

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

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

i.q = j
h.s = j
h.z = a
d.s = h
d.x = h
d.o = h
d.u = a
d.v = a
d.z = a
d.w = a
e.x = d
e.v = f
j.v = f
j.y = h
j.w = a
a.s = h
a.y = j
f.w = a
f.s = h
f.q = h
f.o = e
f.t = b
b.y = d
b.t = e
assert h.z.y.y.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: F = None
        self.x: B = None
        self.v: F = None
        self.o: B = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: B = None
        self.o: D = None
        self.q: B = None
        self.t: H = None
        self.txt = txt

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

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

i.q = j
h.s = j
h.z = a
d.s = h
d.x = h
d.o = h
d.u = a
d.v = a
d.z = a
d.w = a
e.x = d
e.v = f
j.v = f
j.y = h
j.w = a
a.s = h
a.y = j
f.w = a
f.s = h
f.q = h
f.o = e
f.t = b
b.y = d
b.t = e
assert h.z.y.y.s.v.txt == "f"