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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: C = None
        self.o: I = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: C = None
        self.o: I = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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