class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

n.w = j
n.o = i
j.t = l
j.q = l
h.u = d
h.t = d
h.o = j
h.r = c
h.v = i
h.s = i
d.w = j
d.r = n
d.p = n
d.t = h
d.v = h
d.x = i
i.z = n
i.w = j
i.o = h
c.u = h
l.u = n
l.r = c
l.x = i
assert i.o.u.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

n.w = j
n.o = i
j.t = l
j.q = l
h.u = d
h.t = d
h.o = j
h.r = c
h.v = i
h.s = i
d.w = j
d.r = n
d.p = n
d.t = h
d.v = h
d.x = i
i.z = n
i.w = j
i.o = h
c.u = h
l.u = n
l.r = c
l.x = i
assert i.o.u.x.z.txt == "n"