class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.t: E = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: A = None
        self.u: F = None
        self.w: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: A = None
        self.z: B = None
        self.v: A = None
        self.s: D = None
        self.y: B = None
        self.u: F = None
        self.txt = txt

n = A("n")
d = B("d")
m = C("m")
k = D("k")
i = E("i")
h = F("h")
c = G("c")
f = F("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: A = None
        self.u: F = None
        self.w: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: A = None
        self.z: B = None
        self.v: A = None
        self.s: D = None
        self.y: B = None
        self.u: F = None
        self.txt = txt

n = A("n")
d = B("d")
m = C("m")
k = D("k")
i = E("i")
h = F("h")
c = G("c")
f = F("f")

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