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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.w: I = None
        self.q: I = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.x: H = None
        self.w: I = None
        self.v: F = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.w: I = None
        self.q: I = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.x: H = None
        self.w: I = None
        self.v: F = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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