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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.o: A = None
        self.w: F = None
        self.r: D = None
        self.v: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: H = None
        self.y: D = None
        self.w: D = None
        self.o: C = None
        self.txt = txt

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

g = A("g")
h = B("h")
l = C("l")
n = D("n")
f = E("f")
b = F("b")
d = G("d")
a = H("a")

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.o: A = None
        self.w: F = None
        self.r: D = None
        self.v: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: H = None
        self.y: D = None
        self.w: D = None
        self.o: C = None
        self.txt = txt

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

g = A("g")
h = B("h")
l = C("l")
n = D("n")
f = E("f")
b = F("b")
d = G("d")
a = H("a")

g.r = a
g.w = l
h.q = n
h.r = n
h.t = l
h.v = l
h.o = g
h.u = g
h.w = b
l.y = f
n.r = f
n.q = f
n.y = f
n.s = g
n.o = b
n.t = l
n.v = d
f.y = l
b.v = h
b.z = f
d.v = f
d.p = a
d.y = n
d.w = n
d.o = l
a.t = f
a.v = l
a.s = h
a.y = h
a.x = n
assert g.r.x.o.z.txt == "f"