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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: E = None
        self.q: F = None
        self.s: C = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: B = None
        self.p: C = None
        self.v: A = None
        self.x: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: I = None
        self.q: C = None
        self.z: I = None
        self.t: C = None
        self.r: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.s: B = None
        self.w: A = None
        self.t: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: E = None
        self.q: F = None
        self.s: C = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: B = None
        self.p: C = None
        self.v: A = None
        self.x: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: I = None
        self.q: C = None
        self.z: I = None
        self.t: C = None
        self.r: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.s: B = None
        self.w: A = None
        self.t: C = None
        self.txt = txt

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

f.y = b
c.u = m
c.q = m
c.p = e
c.s = d
c.r = d
d.t = e
d.q = e
d.z = k
d.s = k
d.u = f
d.y = m
n.y = f
n.r = e
e.w = f
e.v = f
e.y = c
e.p = d
e.x = i
m.w = d
k.v = f
k.x = b
k.z = b
k.r = b
k.q = d
k.t = d
i.s = c
i.u = e
i.t = e
i.p = d
i.v = d
i.q = b
i.z = b
i.r = m
i.w = k
b.r = n
b.z = c
b.s = c
b.w = f
b.t = d
assert f.y.w.y.z.p.w.y.txt == "b"