class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.y: E = None
        self.q: B = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

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

k.v = l
k.w = l
k.q = l
k.y = g
k.p = m
l.p = g
i.r = l
i.w = l
i.p = m
i.u = c
i.s = k
m.x = i
m.v = c
m.q = l
g.y = l
g.r = k
g.s = k
g.t = i
g.w = m
c.s = g
c.w = g
c.q = g
c.x = m
assert k.p.x.w.p.txt == "g"