class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: F = None
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

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

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

g = A("g")
i = B("i")
m = C("m")
l = D("l")
j = E("j")
e = F("e")
n = C("n")

g.t = e
i.u = j
i.o = l
i.s = g
m.w = i
m.z = i
m.p = e
m.v = g
l.r = n
l.u = g
l.t = g
l.y = j
l.p = j
l.v = i
j.y = l
e.x = j
e.o = n
n.w = i
n.z = i
n.p = e
n.v = g
assert m.w.o.r.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: F = None
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

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

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

g = A("g")
i = B("i")
m = C("m")
l = D("l")
j = E("j")
e = F("e")
n = C("n")

g.t = e
i.u = j
i.o = l
i.s = g
m.w = i
m.z = i
m.p = e
m.v = g
l.r = n
l.u = g
l.t = g
l.y = j
l.p = j
l.v = i
j.y = l
e.x = j
e.o = n
n.w = i
n.z = i
n.p = e
n.v = g
assert m.w.o.r.w.s.txt == "g"