class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: C = None
        self.s: E = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.o: A = None
        self.r: B = None
        self.t: D = None
        self.txt = txt

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

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

j = A("j")
h = B("h")
c = C("c")
g = D("g")
a = E("a")
m = A("m")

j.u = c
j.y = c
j.s = a
j.r = m
j.t = m
h.s = c
h.v = c
h.x = j
h.p = g
c.q = m
c.w = m
c.o = j
c.r = h
c.t = g
g.q = m
g.w = m
g.s = c
a.q = h
a.w = h
a.p = g
m.u = c
m.y = c
m.s = a
m.r = j
m.t = j
assert h.s.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: C = None
        self.s: E = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.o: A = None
        self.r: B = None
        self.t: D = None
        self.txt = txt

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

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

j = A("j")
h = B("h")
c = C("c")
g = D("g")
a = E("a")
m = A("m")

j.u = c
j.y = c
j.s = a
j.r = m
j.t = m
h.s = c
h.v = c
h.x = j
h.p = g
c.q = m
c.w = m
c.o = j
c.r = h
c.t = g
g.q = m
g.w = m
g.s = c
a.q = h
a.w = h
a.p = g
m.u = c
m.y = c
m.s = a
m.r = j
m.t = j
assert h.s.t.s.txt == "c"