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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.p: A = None
        self.x: B = None
        self.txt = txt

d = A("d")
k = B("k")
g = C("g")
j = D("j")
c = E("c")
i = F("i")
l = C("l")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.p: A = None
        self.x: B = None
        self.txt = txt

d = A("d")
k = B("k")
g = C("g")
j = D("j")
c = E("c")
i = F("i")
l = C("l")

d.q = k
d.s = c
d.t = i
k.v = g
k.t = g
k.o = d
k.x = l
g.v = j
g.x = j
g.s = i
g.w = l
g.q = l
g.y = c
j.z = d
j.p = g
c.y = k
c.t = d
c.w = d
c.r = j
i.s = g
i.t = c
i.p = d
i.x = k
l.v = j
l.x = j
l.s = i
l.w = g
l.q = g
l.y = c
assert i.s.w.q.txt == "g"