class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: B = None
        self.u: F = None
        self.y: F = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: E = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.v: B = None
        self.p: G = None
        self.u: A = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: F = None
        self.v: F = None
        self.r: A = None
        self.z: E = None
        self.t: A = None
        self.y: E = None
        self.txt = txt

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

a.p = k
a.u = k
a.y = k
a.s = h
a.q = n
h.v = n
h.r = j
h.u = a
h.y = a
n.o = e
n.w = e
n.q = j
f.t = j
f.z = n
f.y = a
j.t = e
k.y = f
k.r = h
k.v = h
k.z = h
k.p = e
k.u = a
e.q = j
e.z = j
e.y = j
e.o = k
e.v = k
e.r = a
e.t = a
assert a.s.r.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: B = None
        self.u: F = None
        self.y: F = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: E = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.v: B = None
        self.p: G = None
        self.u: A = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: F = None
        self.v: F = None
        self.r: A = None
        self.z: E = None
        self.t: A = None
        self.y: E = None
        self.txt = txt

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

a.p = k
a.u = k
a.y = k
a.s = h
a.q = n
h.v = n
h.r = j
h.u = a
h.y = a
n.o = e
n.w = e
n.q = j
f.t = j
f.z = n
f.y = a
j.t = e
k.y = f
k.r = h
k.v = h
k.z = h
k.p = e
k.u = a
e.q = j
e.z = j
e.y = j
e.o = k
e.v = k
e.r = a
e.t = a
assert a.s.r.t.y.txt == "j"