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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.t: F = None
        self.u: F = None
        self.x: C = None
        self.q: B = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
n = C("n")
b = D("b")
e = E("e")
k = F("k")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.t: F = None
        self.u: F = None
        self.x: C = None
        self.q: B = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
n = C("n")
b = D("b")
e = E("e")
k = F("k")

l.p = b
l.t = b
l.x = n
l.w = n
l.u = n
l.s = e
g.y = n
g.t = e
g.q = k
n.u = g
n.r = g
n.v = e
n.w = k
n.o = b
b.p = l
b.y = k
b.t = k
b.u = k
b.x = n
b.q = g
e.v = l
k.u = n
k.x = g
assert b.q.t.v.txt == "l"