class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: G = None
        self.v: B = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: D = None
        self.q: H = None
        self.x: G = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

h = A("h")
b = B("b")
c = C("c")
i = D("i")
m = E("m")
d = F("d")
f = G("f")
a = H("a")
j = C("j")
l = A("l")

h.x = l
h.w = f
h.v = b
h.z = i
b.o = f
b.z = i
c.y = i
c.p = i
c.q = a
c.x = f
c.v = l
i.y = b
i.v = b
i.x = f
i.r = l
i.t = l
i.u = j
i.w = m
i.p = m
m.r = d
m.t = b
m.v = b
m.z = a
d.r = b
d.s = a
f.q = m
a.o = i
a.s = d
a.x = d
a.v = b
a.z = f
j.y = i
j.p = i
j.q = a
j.x = f
j.v = h
l.x = h
l.w = f
l.v = b
l.z = i
assert d.r.o.q.z.x.r.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: G = None
        self.v: B = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: D = None
        self.q: H = None
        self.x: G = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

h = A("h")
b = B("b")
c = C("c")
i = D("i")
m = E("m")
d = F("d")
f = G("f")
a = H("a")
j = C("j")
l = A("l")

h.x = l
h.w = f
h.v = b
h.z = i
b.o = f
b.z = i
c.y = i
c.p = i
c.q = a
c.x = f
c.v = l
i.y = b
i.v = b
i.x = f
i.r = l
i.t = l
i.u = j
i.w = m
i.p = m
m.r = d
m.t = b
m.v = b
m.z = a
d.r = b
d.s = a
f.q = m
a.o = i
a.s = d
a.x = d
a.v = b
a.z = f
j.y = i
j.p = i
j.q = a
j.x = f
j.v = h
l.x = h
l.w = f
l.v = b
l.z = i
assert d.r.o.q.z.x.r.z.x.txt == "f"