class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.q: E = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: E = None
        self.r: G = None
        self.p: B = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: H = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.y: A = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

a = A("a")
c = B("c")
j = C("j")
h = D("h")
g = E("g")
n = F("n")
b = G("b")
i = H("i")
f = H("f")

a.x = c
a.w = c
a.r = b
a.q = g
c.z = n
c.t = h
c.y = a
j.z = b
j.r = b
j.w = g
j.p = c
j.v = h
h.y = c
h.p = j
h.r = g
g.z = b
n.o = h
n.p = f
n.q = c
b.w = a
b.y = a
b.q = h
b.z = n
i.p = j
f.p = j
assert j.r.z.q.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.q: E = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: E = None
        self.r: G = None
        self.p: B = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: H = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.y: A = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

a = A("a")
c = B("c")
j = C("j")
h = D("h")
g = E("g")
n = F("n")
b = G("b")
i = H("i")
f = H("f")

a.x = c
a.w = c
a.r = b
a.q = g
c.z = n
c.t = h
c.y = a
j.z = b
j.r = b
j.w = g
j.p = c
j.v = h
h.y = c
h.p = j
h.r = g
g.z = b
n.o = h
n.p = f
n.q = c
b.w = a
b.y = a
b.q = h
b.z = n
i.p = j
f.p = j
assert j.r.z.q.t.y.txt == "c"