class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: G = None
        self.y: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: A = None
        self.s: F = None
        self.r: B = None
        self.x: F = None
        self.y: B = None
        self.txt = txt

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

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

f = A("f")
g = B("g")
k = C("k")
a = D("a")
j = E("j")
m = F("m")
e = G("e")
i = F("i")
d = C("d")
b = A("b")

f.s = i
f.x = e
f.y = e
g.s = i
k.o = a
k.v = a
k.s = a
k.p = f
a.o = e
a.x = g
a.u = f
j.u = g
j.r = g
j.y = g
j.z = f
j.s = m
j.x = m
m.r = k
m.o = i
e.y = g
i.r = d
i.o = m
d.o = a
d.v = a
d.s = a
d.p = b
b.s = m
b.x = e
b.y = e
assert b.s.r.o.u.y.y.s.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: G = None
        self.y: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: A = None
        self.s: F = None
        self.r: B = None
        self.x: F = None
        self.y: B = None
        self.txt = txt

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

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

f = A("f")
g = B("g")
k = C("k")
a = D("a")
j = E("j")
m = F("m")
e = G("e")
i = F("i")
d = C("d")
b = A("b")

f.s = i
f.x = e
f.y = e
g.s = i
k.o = a
k.v = a
k.s = a
k.p = f
a.o = e
a.x = g
a.u = f
j.u = g
j.r = g
j.y = g
j.z = f
j.s = m
j.x = m
m.r = k
m.o = i
e.y = g
i.r = d
i.o = m
d.o = a
d.v = a
d.s = a
d.p = b
b.s = m
b.x = e
b.y = e
assert b.s.r.o.u.y.y.s.r.v.txt == "a"