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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: E = None
        self.s: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

d = A("d")
h = B("h")
l = C("l")
j = D("j")
m = E("m")
f = F("f")

d.v = h
h.p = d
h.w = m
h.s = m
h.v = f
l.o = j
l.y = d
l.u = d
l.w = h
l.x = m
l.v = f
j.o = h
j.r = m
j.q = l
m.y = l
m.w = d
m.p = f
f.q = h
f.x = m
f.r = m
f.u = j
f.o = l
assert h.s.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: E = None
        self.s: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

d = A("d")
h = B("h")
l = C("l")
j = D("j")
m = E("m")
f = F("f")

d.v = h
h.p = d
h.w = m
h.s = m
h.v = f
l.o = j
l.y = d
l.u = d
l.w = h
l.x = m
l.v = f
j.o = h
j.r = m
j.q = l
m.y = l
m.w = d
m.p = f
f.q = h
f.x = m
f.r = m
f.u = j
f.o = l
assert h.s.p.o.txt == "l"