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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: B = None
        self.q: A = None
        self.r: C = None
        self.w: B = None
        self.txt = txt

g = A("g")
b = B("b")
d = C("d")
i = D("i")
f = E("f")
l = F("l")

g.q = b
g.r = b
g.v = f
g.u = f
g.w = l
b.o = d
b.x = g
b.t = g
b.p = g
b.v = i
d.q = b
i.v = b
i.x = b
i.o = d
i.p = d
f.q = l
f.s = d
l.x = d
l.r = d
l.u = b
l.w = b
l.q = g
assert b.v.v.t.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.r: B = None
        self.u: E = None
        self.w: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: B = None
        self.q: A = None
        self.r: C = None
        self.w: B = None
        self.txt = txt

g = A("g")
b = B("b")
d = C("d")
i = D("i")
f = E("f")
l = F("l")

g.q = b
g.r = b
g.v = f
g.u = f
g.w = l
b.o = d
b.x = g
b.t = g
b.p = g
b.v = i
d.q = b
i.v = b
i.x = b
i.o = d
i.p = d
f.q = l
f.s = d
l.x = d
l.r = d
l.u = b
l.w = b
l.q = g
assert b.v.v.t.w.w.txt == "b"