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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: G = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: G = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.x: A = None
        self.txt = txt

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

f.w = j
e.p = h
e.y = k
e.q = j
g.s = k
g.o = i
g.q = e
g.u = j
h.v = e
h.q = j
h.u = g
h.y = f
j.o = i
j.v = e
i.t = j
k.o = j
k.t = h
k.x = f
assert j.v.p.v.p.txt == "h"