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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: F = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: G = None
        self.w: E = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: F = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: F = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: G = None
        self.w: E = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: F = None
        self.y: D = None
        self.txt = txt

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

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

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

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