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

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

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

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

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

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

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

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

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

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

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

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

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

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

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