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

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

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

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

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

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

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

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

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

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

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

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

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

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

j.p = i
j.w = i
j.t = i
j.r = c
j.v = g
j.o = g
i.y = j
i.r = g
i.w = k
i.o = k
k.q = i
h.p = k
h.v = j
h.s = i
c.v = i
c.t = h
c.y = h
c.p = k
c.q = g
g.p = j
assert c.v.r.p.txt == "j"