class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.txt = txt

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

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