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

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

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

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

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

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

e = A("e")
m = B("m")
g = C("g")
h = D("h")
i = E("i")
f = F("f")
n = D("n")

e.u = n
e.w = g
e.q = f
e.s = m
m.o = e
m.p = e
m.t = f
m.z = f
g.v = e
h.w = i
h.v = e
h.r = e
h.t = g
i.u = f
i.w = f
i.v = e
f.y = i
n.w = i
n.v = e
n.r = e
n.t = g
assert g.v.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: C = None
        self.q: F = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

e = A("e")
m = B("m")
g = C("g")
h = D("h")
i = E("i")
f = F("f")
n = D("n")

e.u = n
e.w = g
e.q = f
e.s = m
m.o = e
m.p = e
m.t = f
m.z = f
g.v = e
h.w = i
h.v = e
h.r = e
h.t = g
i.u = f
i.w = f
i.v = e
f.y = i
n.w = i
n.v = e
n.r = e
n.t = g
assert g.v.s.t.txt == "f"