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

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

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

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

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

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

k = A("k")
b = B("b")
j = C("j")
c = D("c")
f = E("f")
g = F("g")
h = B("h")
e = A("e")

k.y = e
k.v = c
k.r = c
k.x = f
b.u = j
b.q = h
b.v = c
b.x = c
j.p = e
j.o = k
j.s = g
j.v = b
j.r = c
c.v = k
c.u = b
c.r = j
c.x = e
f.w = j
f.x = j
f.r = h
f.y = g
g.x = f
g.z = j
g.w = c
g.y = h
h.u = j
h.q = b
h.v = c
h.x = c
e.y = k
e.v = c
e.r = c
e.x = f
assert e.v.r.r.u.v.x.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.x: E = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

k = A("k")
b = B("b")
j = C("j")
c = D("c")
f = E("f")
g = F("g")
h = B("h")
e = A("e")

k.y = e
k.v = c
k.r = c
k.x = f
b.u = j
b.q = h
b.v = c
b.x = c
j.p = e
j.o = k
j.s = g
j.v = b
j.r = c
c.v = k
c.u = b
c.r = j
c.x = e
f.w = j
f.x = j
f.r = h
f.y = g
g.x = f
g.z = j
g.w = c
g.y = h
h.u = j
h.q = b
h.v = c
h.x = c
e.y = k
e.v = c
e.r = c
e.x = f
assert e.v.r.r.u.v.x.r.v.txt == "k"