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

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

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

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

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

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

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

e = A("e")
j = B("j")
d = C("d")
f = D("f")
i = E("i")
h = F("h")
l = G("l")

e.y = h
j.q = h
j.s = h
j.r = h
d.y = i
d.s = i
d.r = f
d.w = h
d.v = h
d.t = h
f.s = h
f.p = d
i.x = d
i.z = h
h.z = l
h.y = j
l.p = f
assert i.x.y.x.r.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

e = A("e")
j = B("j")
d = C("d")
f = D("f")
i = E("i")
h = F("h")
l = G("l")

e.y = h
j.q = h
j.s = h
j.r = h
d.y = i
d.s = i
d.r = f
d.w = h
d.v = h
d.t = h
f.s = h
f.p = d
i.x = d
i.z = h
h.z = l
h.y = j
l.p = f
assert i.x.y.x.r.p.v.txt == "h"