class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.y: D = None
        self.u: B = None
        self.o: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: D = None
        self.p: G = None
        self.z: G = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: I = None
        self.y: I = None
        self.s: I = None
        self.p: D = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: D = None
        self.p: G = None
        self.z: G = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: I = None
        self.y: I = None
        self.s: I = None
        self.p: D = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

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

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

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

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