class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: G = None
        self.t: A = None
        self.u: F = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.q: F = None
        self.o: F = None
        self.r: F = None
        self.txt = txt

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

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

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

c.y = b
c.w = d
a.u = d
a.r = c
b.t = c
b.s = d
b.z = n
b.u = n
f.o = c
f.t = c
f.y = c
f.r = h
f.u = d
n.z = f
n.u = b
n.q = d
n.o = d
n.r = d
d.z = f
d.s = f
d.r = f
d.w = f
d.q = h
j.o = f
j.w = c
j.s = a
j.q = a
j.x = n
j.z = h
j.t = h
h.o = f
h.w = c
h.s = a
h.q = a
h.x = n
h.z = j
h.t = j
assert j.w.w.z.r.t.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: G = None
        self.t: A = None
        self.u: F = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.q: F = None
        self.o: F = None
        self.r: F = None
        self.txt = txt

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

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

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

c.y = b
c.w = d
a.u = d
a.r = c
b.t = c
b.s = d
b.z = n
b.u = n
f.o = c
f.t = c
f.y = c
f.r = h
f.u = d
n.z = f
n.u = b
n.q = d
n.o = d
n.r = d
d.z = f
d.s = f
d.r = f
d.w = f
d.q = h
j.o = f
j.w = c
j.s = a
j.q = a
j.x = n
j.z = h
j.t = h
h.o = f
h.w = c
h.s = a
h.q = a
h.x = n
h.z = j
h.t = j
assert j.w.w.z.r.t.o.r.txt == "h"