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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: C = None
        self.t: E = None
        self.x: A = None
        self.p: A = None
        self.txt = txt

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

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

b = A("b")
n = B("n")
c = C("c")
i = D("i")
g = E("g")
l = C("l")
a = A("a")
f = A("f")
m = E("m")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: C = None
        self.t: E = None
        self.x: A = None
        self.p: A = None
        self.txt = txt

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

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

b = A("b")
n = B("n")
c = C("c")
i = D("i")
g = E("g")
l = C("l")
a = A("a")
f = A("f")
m = E("m")

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