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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: F = None
        self.p: D = None
        self.x: B = None
        self.w: B = None
        self.z: D = None
        self.y: F = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.z: A = None
        self.s: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: F = None
        self.p: D = None
        self.x: B = None
        self.w: B = None
        self.z: D = None
        self.y: F = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.z: A = None
        self.s: C = None
        self.o: B = None
        self.txt = txt

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

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

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