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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: A = None
        self.r: A = None
        self.s: I = None
        self.y: A = None
        self.z: A = None
        self.v: B = None
        self.o: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: D = None
        self.w: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: A = None
        self.r: A = None
        self.s: I = None
        self.y: A = None
        self.z: A = None
        self.v: B = None
        self.o: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: D = None
        self.w: A = None
        self.v: C = None
        self.txt = txt

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

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