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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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