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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

b.p = l
b.y = j
b.x = g
l.x = m
l.v = m
k.w = m
k.t = m
k.u = b
k.o = l
k.y = j
m.x = b
m.o = l
m.s = k
m.r = k
m.u = j
m.t = g
g.x = k
g.t = k
g.u = m
j.r = b
c.x = k
c.t = k
c.u = m
assert c.x.w.s.u.p.x.r.txt == "k"