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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: E = None
        self.x: E = None
        self.s: B = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: E = None
        self.x: E = None
        self.s: B = None
        self.p: A = None
        self.txt = txt

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

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

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

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