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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: F = None
        self.y: B = None
        self.z: G = None
        self.txt = txt

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

g.s = b
g.y = f
g.w = l
i.r = b
l.s = d
f.p = g
f.u = l
d.w = j
d.y = c
d.o = i
d.z = k
d.s = g
b.r = f
n.v = f
c.t = b
c.p = k
k.w = l
k.p = b
k.y = i
k.z = j
j.v = f
assert f.u.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: D = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: F = None
        self.y: B = None
        self.z: G = None
        self.txt = txt

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

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