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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: F = None
        self.y: A = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: D = None
        self.u: F = None
        self.r: D = None
        self.txt = txt

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

f = A("f")
a = B("a")
k = C("k")
h = D("h")
g = E("g")
l = F("l")

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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: F = None
        self.y: A = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: D = None
        self.u: F = None
        self.r: D = None
        self.txt = txt

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

f = A("f")
a = B("a")
k = C("k")
h = D("h")
g = E("g")
l = F("l")

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