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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: G = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: F = None
        self.y: C = None
        self.x: F = None
        self.r: D = None
        self.o: E = None
        self.s: A = None
        self.txt = txt

l = A("l")
h = B("h")
f = C("f")
k = D("k")
e = E("e")
m = F("m")
g = G("g")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: G = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: F = None
        self.y: C = None
        self.x: F = None
        self.r: D = None
        self.o: E = None
        self.s: A = None
        self.txt = txt

l = A("l")
h = B("h")
f = C("f")
k = D("k")
e = E("e")
m = F("m")
g = G("g")

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