class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.u: E = None
        self.s: G = None
        self.z: F = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: B = None
        self.y: B = None
        self.txt = txt

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

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

f = A("f")
g = B("g")
i = C("i")
d = D("d")
j = E("j")
a = F("a")
k = G("k")

f.w = a
f.u = a
f.v = j
g.v = f
g.p = a
g.z = a
g.u = j
g.o = j
g.w = j
g.s = k
i.t = j
i.y = k
i.v = k
i.r = a
i.w = d
d.p = k
j.x = d
j.s = g
j.y = g
a.z = k
k.x = a
k.q = j
assert f.v.s.w.y.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.u: E = None
        self.s: G = None
        self.z: F = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: B = None
        self.y: B = None
        self.txt = txt

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

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

f = A("f")
g = B("g")
i = C("i")
d = D("d")
j = E("j")
a = F("a")
k = G("k")

f.w = a
f.u = a
f.v = j
g.v = f
g.p = a
g.z = a
g.u = j
g.o = j
g.w = j
g.s = k
i.t = j
i.y = k
i.v = k
i.r = a
i.w = d
d.p = k
j.x = d
j.s = g
j.y = g
a.z = k
k.x = a
k.q = j
assert f.v.s.w.y.v.u.txt == "a"