class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: A = None
        self.p: G = None
        self.q: D = None
        self.s: C = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.x: B = None
        self.t: C = None
        self.y: D = None
        self.v: B = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: A = None
        self.p: G = None
        self.q: D = None
        self.s: C = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.x: B = None
        self.t: C = None
        self.y: D = None
        self.v: B = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: G = None
        self.txt = txt

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

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