class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: D = None
        self.z: E = None
        self.txt = txt

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

e = A("e")
j = B("j")
h = C("h")
k = D("k")
l = E("l")
a = B("a")
b = D("b")
f = A("f")
g = B("g")

e.y = l
e.o = l
e.x = g
j.x = g
j.y = f
j.s = l
h.x = l
k.s = g
k.w = b
k.z = l
l.z = f
a.x = j
a.y = f
a.s = l
b.s = j
b.w = k
b.z = l
f.y = l
f.o = l
f.x = g
g.x = a
g.y = e
g.s = l
assert e.y.z.o.z.o.z.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: D = None
        self.z: E = None
        self.txt = txt

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

e = A("e")
j = B("j")
h = C("h")
k = D("k")
l = E("l")
a = B("a")
b = D("b")
f = A("f")
g = B("g")

e.y = l
e.o = l
e.x = g
j.x = g
j.y = f
j.s = l
h.x = l
k.s = g
k.w = b
k.z = l
l.z = f
a.x = j
a.y = f
a.s = l
b.s = j
b.w = k
b.z = l
f.y = l
f.o = l
f.x = g
g.x = a
g.y = e
g.s = l
assert e.y.z.o.z.o.z.y.z.txt == "f"