class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: G = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: F = None
        self.v: F = None
        self.w: F = None
        self.z: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: E = None
        self.p: D = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

k = A("k")
d = B("d")
n = C("n")
j = D("j")
h = E("h")
l = F("l")
g = G("g")

k.w = n
k.y = n
k.x = g
d.o = h
d.u = g
d.t = g
d.r = g
n.x = j
n.u = l
n.v = l
n.w = l
n.z = l
j.x = l
j.p = n
h.w = j
h.s = d
h.p = d
h.o = g
l.u = h
g.r = j
g.p = j
g.x = h
g.w = n
g.z = k
assert k.x.x.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: G = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: F = None
        self.v: F = None
        self.w: F = None
        self.z: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: E = None
        self.p: D = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

k = A("k")
d = B("d")
n = C("n")
j = D("j")
h = E("h")
l = F("l")
g = G("g")

k.w = n
k.y = n
k.x = g
d.o = h
d.u = g
d.t = g
d.r = g
n.x = j
n.u = l
n.v = l
n.w = l
n.z = l
j.x = l
j.p = n
h.w = j
h.s = d
h.p = d
h.o = g
l.u = h
g.r = j
g.p = j
g.x = h
g.w = n
g.z = k
assert k.x.x.o.w.txt == "n"