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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: B = None
        self.y: B = None
        self.p: E = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

i.p = c
i.u = c
i.v = j
j.o = e
j.z = e
j.r = i
h.x = j
h.v = j
h.y = j
h.p = e
h.r = e
h.o = i
g.t = e
g.w = c
e.z = h
c.v = g
c.y = g
c.p = i
l.x = j
l.v = j
l.y = j
l.p = e
l.r = e
l.o = i
assert c.v.w.p.v.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: B = None
        self.y: B = None
        self.p: E = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

i.p = c
i.u = c
i.v = j
j.o = e
j.z = e
j.r = i
h.x = j
h.v = j
h.y = j
h.p = e
h.r = e
h.o = i
g.t = e
g.w = c
e.z = h
c.v = g
c.y = g
c.p = i
l.x = j
l.v = j
l.y = j
l.p = e
l.r = e
l.o = i
assert c.v.w.p.v.r.v.txt == "j"